package org.smarthings.things.automation.engine;

import org.smarthings.things.management.Thing;
import org.smarthings.things.management.ThingsRegistry;

public class ThingsRegistryFacade {

	private ThingsRegistry thingsRegistry;

	public ThingsRegistryFacade(ThingsRegistry thingsRegistry) {
		this.thingsRegistry = thingsRegistry;
	}

	public ThingFacade byName(String name) {
		Thing thing = thingsRegistry.getThingByName(name);
		if (thing != null) {
			return new ThingFacade(thing);
		}
		return null;
	}

	public ThingFacade byTag(String tag) {
		Thing thing = thingsRegistry.getThingByTag(tag);
		if (thing != null) {
			return new ThingFacade(thing);
		}
		return null;
	}

	public ThingFacade byUUID(String UUID) {
		Thing thing = thingsRegistry.getThing(UUID);
		if (thing != null) {
		return new ThingFacade(thing);
		}
		return null;
	}

	public ThingCollectionFacade byFilter(String filter) {
		return null;
	}

}
